export const noNegative = async (rules: Array<any>, value: number) => {
  if (value < 0) {
    return Promise.reject('请输入非0整数');
  } else {
    return Promise.resolve();
  }
};

export const mobileExp = async (rules: Array<any>, value: number) => {
  // if(!value) {
  //     return Promise.reject('请输入手机号')
  // } else if() {
  //     return Promise.reject('请校验手机号的正确性')
  // } else {
  //     return Promise.resolve()
  // }
};

export const clientIdValidator = async (rules: Array<any>, value: string) => {
  const reg = /^[a-zA-Z0-9_-]+$/;
  if (!value) {
    return Promise.reject('请输入应用id');
  } else if (!reg.test(value)) {
    return Promise.reject('请勿输入字母、数字、下划线之外的字符');
  } else {
    return Promise.resolve();
  }
};
